#import "GTKButton.h"
#import <gtk/gtk.h>

@implementation GTKButton
// CreateWidget is called by [GTKWidget new] to initalize GtkWidget *widget
- createWidget
{
	widget = gtk_button_new();
	return self;
}
// Set's the label on the GTKButton
- label: (char*) label
{
	gtk_button_set_label(widget, label);
	return self;
}
// Retrieves the label from the button
- (char*) label
{
	return gtk_button_get_label(widget);
}
// Sets the image on a button
- image: (GtkWidget*) image
{
	gtk_button_set_image(widget, image);
	return self;
}
// Retrieves the image (if any) set on the button
- (GtkWidget*) image
{
	return gtk_button_get_image(widget);
}
// Begin events

- onClick: function
{
	g_signal_connect (G_OBJECT (widget), "clicked", G_CALLBACK ( function ), self);
}

- onActivate: function
{
	g_signal_connect (G_OBJECT (widget), "activate", G_CALLBACK ( function ), self);
}

- onPressed: function
{
	g_signal_connect (G_OBJECT (widget), "pressed", G_CALLBACK ( function ), self);
}

- onReleased: function
{
	g_signal_connect (G_OBJECT (widget), "released", G_CALLBACK ( function ), self);
}

- onEnter: function
{
	g_signal_connect (G_OBJECT (widget), "enter", G_CALLBACK ( function ), self);
}

- onLeave: function
{
	g_signal_connect (G_OBJECT (widget), "leave", G_CALLBACK ( function ), self);
}

@end
